﻿#pragma once
#include <OgreCamera.h>
#include <OgreEntity.h>
#include <OgreLogManager.h>
#include <OgreRoot.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreConfigFile.h>

#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>

#include <SdkTrays.h>
#include <SdkCameraMan.h>

#include "Level.h"

using namespace Ogre;

class TrackBirdListener :public Ogre::FrameListener, public Ogre::WindowEventListener, public OIS::KeyListener
{
public:
	TrackBirdListener(Root *root,Camera *camera, SceneManager* sm,
		RenderWindow *rw,OIS::Keyboard*kb,OIS::InputManager* im)
		:mRoot(root),mCamera(camera),mSceneMgr(sm),mWindow(rw),mKeyboard(kb),mInputManager(im),mShutDown(false),observeMode(0){}

	~TrackBirdListener(void);

	//֡
	virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
	virtual bool keyPressed( const OIS::KeyEvent &arg );
	virtual bool keyReleased( const OIS::KeyEvent &arg );

	void windowClosed(Ogre::RenderWindow* rw);

	//private:
	//Level* level;
	Ogre::Root *mRoot;
	Ogre::Camera* mCamera;
	Ogre::SceneManager* mSceneMgr;
	Ogre::RenderWindow* mWindow;

	bool mShutDown;

	//OIS Input devices
	OIS::InputManager* mInputManager;
	//OIS::Mouse*    mMouse;
	OIS::Keyboard* mKeyboard;

	int observeMode;

};

